package servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.CarDao;
import entity.CarInfo;

public class EditCarServlet extends HttpServlet {
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setContentType("text/html; charset=UTF-8");
		
		
		int carid = Integer.parseInt(request.getParameter("carid")); 
		CarInfo car = new CarDao().get(carid);
		
		request.setAttribute("car", car);
		request.getRequestDispatcher("editCar.jsp").forward(request, response);
		
	}

}
